package wechat.service.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import wechat.resources.InstanceResource;
import wechat.service.DepartmentService;
import wechat.service.base.BaseRequest;

@Service
public class IDepartmentService extends BaseRequest implements DepartmentService {

	private Logger log = LoggerFactory.getLogger(IDepartmentService.class);
	
	@Autowired
	IAccessTokenService accessTokenService;
	
	public String getDepartmentList(InstanceResource instanceResource,String department_id) throws Exception{
		String access_token = accessTokenService.getAccessToken(instanceResource).getAccessToken();
		boolean isCheck = false;
		
		if (department_id == null) {
			department_id = "";
		}
		
		String departmentList = super.listDepartment(access_token, department_id, isCheck);
		
		return departmentList;
	}
	

}
